package com.akkainaction.cluster.wordcount.router.group;

import akka.actor.ActorRef;
import akka.actor.ActorSystem;
import akka.actor.Props;
import akka.actor.UntypedActor;
import com.typesafe.config.ConfigFactory;

public class MasterActor extends UntypedActor {

    @Override
    public void onReceive(Object msg) throws Exception {
        System.out.println(getSelf() + "接收到消息:[" + msg + "]");
    }

    public static void main(String[] args) {
        ActorSystem system = ActorSystem.create("sys", ConfigFactory.load("group/wordcount-router-group-front.conf"));
        ActorRef masterActor = system.actorOf(Props.create(MasterActor.class), "masterActor");
        masterActor.tell("hello",ActorRef.noSender());
    }
}
